<include file="Public:head" />
<body>
<div id="body-wrapper">
  <div id="sidebar">
    <div id="sidebar-wrapper">
		<include file="Public:left-nav" />
    </div>
  </div>
  <!-- End #sidebar -->
  <div id="main-content">
    <!-- Page Head -->
    <ul class="shortcut-buttons-set">
      <li><a class="shortcut-button" href="__APP__/News/add"><span><img src="__PUBLIC__/admin/images/icons/paper_content_pencil_48.png"><br/>新增</span></a></li>
	  <li><a class="shortcut-button" href="__APP__/News/delhome"><span><img src="__PUBLIC__/admin/images/icons/10.png"><br/>回收站</span></a></li>
    </ul>
    <!-- End .shortcut-buttons-set -->
    <div class="clear"></div>
    <!-- End .clear -->
    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h4>新闻动态管理</h4>
      </div>
      <!-- End .content-box-header -->
<script type="text/javascript">
		$(document).ready(function(){
				$('select[name=classif]').val('{$classif}');
				$('.status').bind('click',function(){
						var numid = $(this).attr("num");
				$.post('__URL__/status/'+numid,function(jdata){
						//if(confirm("<?php echo $confirm?>")){
						if(jdata.status==1){
										if(jdata.data!=''){
												$('#ajax').show().animate({'margin-top':'5px'}).html('<div><b>'+jdata.info+'</b></div>').delay(100).animate({'margin-top':'-5px'}).fadeOut(500);
												$('.status[num='+numid+']').html(jdata.data);
										}else{
											alert('数据有误，请联系管理员！');
										}
								}else{
												$('#ajax').show().animate({'margin-top':'5px'}).html('<div><b>'+jdata.info+'</b></div>').delay(100).animate({'margin-top':'-5px'}).fadeOut(500);
												$('.status[num='+numid+']').html(jdata.data);
										}
						//}
				});
		});
				$('.del').bind('click',function(){
					if(confirm("确定删除到回收站吗？")){
						var numid = $(this).attr("delnum");
				$.post('__URL__/del/'+numid,function(jdata){
						//if(confirm("<?php echo $confirm?>")){
						if(jdata.status==3){
										if(jdata.data!=''){
												$('#ajax').show().animate({'margin-top':'5px'}).html('<div><b>'+jdata.info+'</b></div>').delay(300).animate({'margin-top':'-5px'}).fadeOut(500);
												$('tr[delnum='+numid+']').remove();
										}else{
											alert('数据有误，请联系管理员！');
										}
								}else{
												$('#ajax').show().animate({'margin-top':'5px'}).html('<div><b>'+jdata.info+'</b></div>').delay(300).animate({'margin-top':'-5px'}).fadeOut(500);
												//$('<?php echo $button?>[num='+numid+']').html(jdata.data);
										}
						//}
				});
					} //confirm end
		});
		
				$('.overtext').each(function(){
					var maxwidth=20;
					 if($(this).text().length>maxwidth){   
						$(this).text($(this).text().substring(0,maxwidth));    
						$(this).html($(this).html()+'...');    
						}    
				});

		});
</script>
<div id="ajax" class="notification" style="width:20%;margin-left:22%; position: absolute;top:10%;background-color:#99ff00;display:none;position:fixed;z-index:1000;">
      
    </div>
<div class="content-box-content">
        <div class="tab-content default-tab">
         <div class="notification information">
      <div>
				<form method="post" action="__APP__/News">
					<div id="soso">
                    <select name="classif">
                      <option value="0">&nbsp;&nbsp;&nbsp;全&nbsp;部</option>
                      <option value="1">公司要闻</option>
                      <option value="2">最新动态</option>
					  <option value="3">专题活动</option>
					  <option value="4">有关媒体与机构报道</option>
					  <option value="5">公司公告</option>
                    </select>
					<input type="text" name="text" value="{$soso}">
					<input type="submit" value="开始搜索">
                    <!-- <a class="button">开始搜索</a>  -->
				</div>
				</form>
	 </div>
    </div>
          <table>
            <thead>
              <tr>
                <th>
                  编号
                </th>
                <th>标题</th>
                <th>负责人</th>
                <th>发布日期</th>
				<th>分类</th>
				<th>状态</th>
				<th>备注</th>
				<th>操作</th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="6">
                  <div class="bulk-actions align-left">
						<!-- <button id="submit">批量删除</button> -->
				  </div>
                  <div class="pagination"><a href="#" class="number current">{$page}{$empty}</a> 
				  </div>
                  <!-- End .pagination -->
                  <div class="clear"></div>
                </td>
              </tr>
            </tfoot>
            <tbody>
			<foreach name="list" item="vo">
              <tr delnum="{$vo.id}">
                <td>
                  <!-- <input type="checkbox" value="{$vo.id}" name='id[]'/> -->{$vo.id}
                </td>
                <td><a href="__ROOT__/News/index_show/{$vo.id}"  target="_blank" class="overtext">{$vo.title}</a></td>
                <td>{$vo.yourname}</td>
                <td>{$vo.last_time|date='Y-m-d H:i:s',###}</td>
				<td>
					<switch name="vo.classif">
						<case value="1">【公司要闻】</case>
						<case value="2">【最新动态】</case>
						<case value="3">【专题活动】</case>
						<case value="4">【有关媒体与机构报道】</case>
						<case value="5">【公司公告】</case>
					</switch>
					</td>
				<td><switch name="vo.status">
						<case value="1"><span class="status" num="{$vo.id}" style="color:#33cc00;cursor: pointer;">发布中</case>
						<case value="2"><span style="color:#808080;cursor: pointer;" class="status" num="{$vo.id}">关闭发布</span></case>
					</switch></td>
				<td>{$vo.remark}</td>
                <td>
                  <a href="__APP__/News/edit/{$vo.id}" title="编辑用户"><img src="__PUBLIC__/admin/images/icons/pencil.png" alt="Edit" /></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" class="del" delnum="{$vo.id}"><img src="__PUBLIC__/admin/images/icons/cross.png" alt="Delete" /></a> </td>
              </tr>
			 </foreach>
            </tbody>
          </table>
        </div>
      </div>
      <!-- End .content-box-content -->
    </div>
    <div id="footer"> <small>
      &#169;腾驹达后台 2013| Powered by <a href="#">admin</a> | <a href="#">Top</a> </small> 
	  </div>
    <!-- End #footer -->
  </div>
  <!-- End #main-content -->
</div>
<!-- End #body-wrapper-->
</body>
</html>
